/**
 * Copyright 2007 Igor Chaves Cananéa
 *
 * This file is part of PBSFW
 *
 * PBSFW is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * PBSFW is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _DEFINES_H_
#define _DEFINES_H_

// Include typedefs for uint16_t, uint32_t, uint64_t, etc
#include <stdint.h>

#define CONST_PI	((double)3.14159265358979323846)	/* PI */
#define PI_DIV_180	((double)0.01745329251994329577)	/* PI/180 */
#define INV_PI_DIV_180 ((double)57.295779513082320876) /* 180/PI */

#define INFINITE -1
#define INFINITE_TIME -1.0
#define MAX_UINT_32 ((uint32_t) 0xFFFFFFFF)
#define MAX_UINT_64 ((uint64_t) 0xFFFFFFFFFFFFFFFF)

typedef double  simtime_t;
typedef double  distance_t;
typedef int16_t velocity_t;
typedef int16_t direction_t;
typedef int16_t point_t;

inline velocity_t kmh2ms(velocity_t v) {
	return velocity_t(v * 0.27777777778);
}

inline velocity_t ms2kmh(velocity_t v) {
	return velocity_t(v * 3.6);
}

inline direction_t grad2rad(direction_t angle) {
	return direction_t(angle * PI_DIV_180);
}

inline direction_t rad2grad(direction_t angle) {
	return direction_t(angle * INV_PI_DIV_180);
}

#endif
